package com.urea.system.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.urea.common.annotation.Excel;
import com.urea.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 退款记录 t_order_refund
 *
 * @author liuzd
 * @date 2023-08-01
 */
@TableName("t_order_refund")
@Data
@ToString
public class OrderRefund extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 退款单号
     */
    @Excel(name = "退款单号")
    @ApiModelProperty("退款单号")
    private String refundNo;

    /**
     * 支付订单号
     */
    @Excel(name = "支付订单号")
    @ApiModelProperty("支付订单号")
    private String orderNo;


    /**
     * 退款金额
     */
    @Excel(name = "退款金额")
    @ApiModelProperty("退款金额")
    private BigDecimal refundAmount;


    /**
     * 退款状态;0处理中，1成功，2失败
     */
    @Excel(name = "退款状态;0处理中，1成功，2失败")
    @ApiModelProperty("退款状态;0处理中，1成功，2失败")
    private Integer refundStatus;


    /**
     * 额外信息
     */
    @Excel(name = "额外信息")
    @ApiModelProperty("额外信息")
    private String extraInfo;


    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    public OrderRefund() {
    }

    public OrderRefund(String refundNo, String orderNo, BigDecimal refundAmount, Integer refundStatus) {
        this.refundNo = refundNo;
        this.orderNo = orderNo;
        this.refundAmount = refundAmount;
        this.refundStatus = refundStatus;
    }

    public OrderRefund(String refundNo, String orderNo, BigDecimal refundAmount, Integer refundStatus, String extraInfo) {

        this.refundNo = refundNo;
        this.orderNo = orderNo;
        this.refundAmount = refundAmount;
        this.refundStatus = refundStatus;
        this.extraInfo = extraInfo;
    }
}
